import java.util.*;
import java.util.Stack;

public class code2 {

    Stack<Integer> stack = new Stack<>();

    public void push(int node) {
        stack.add(node);
    }

    public void pop() {
        stack.pop();
    }

    public int top() {
        return stack.peek();
    }

    public int min() {
        return Collections.min(stack);
    }
}
